package cjq.demo.thread.ch6_6;

import java.util.concurrent.ConcurrentSkipListMap;

/**
 * Created by Administrator on 2016/5/6.
 */
public class Task implements Runnable {

    private ConcurrentSkipListMap<String,Contact> map ;
    private String id;

    public Task(ConcurrentSkipListMap<String,Contact> map,String id){
        this.id= id;
        this.map = map;
    }

    public void run(){
        for (int i = 0; i < 1000; i++) {
            Contact contact = new Contact(id,String.valueOf(i+1000));
            map.put(id+contact.getPhone(),contact);
        }
    }
}
